package com.logistics.controller;

import com.logistics.common.Result;
import com.logistics.service.DashboardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/dashboard")
public class DashboardController {

    @Autowired
    private DashboardService dashboardService;

    @GetMapping("/statistics")
    public Result<Map<String, Object>> getStatistics() {
        return dashboardService.getStatistics();
    }

    @GetMapping("/order-status")
    public Result<List<Map<String, Object>>> getOrderStatus() {
        return dashboardService.getOrderStatus();
    }

    @GetMapping("/warehouse-usage")
    public Result<List<Map<String, Object>>> getWarehouseUsage() {
        return dashboardService.getWarehouseUsage();
    }

    @GetMapping("/order-trend")
    public Result<List<Map<String, Object>>> getOrderTrend() {
        return dashboardService.getOrderTrend();
    }
} 